#ifndef	__CAMER_H 
#define __CAMER_H
#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#include<stdlib.h>
#include<linux/videodev2.h>
#include<sys/ioctl.h>
#include<errno.h>                                                                                     
#include<string.h>
#include<assert.h>
#include<getopt.h>
#include<sys/stat.h>
#include<sys/mman.h>
#include<asm/types.h>
#include<linux/fb.h>
#include "config.h"

#define CLEAN(x) (memset(&(x), 0, sizeof(x)))

typedef struct Video_Buffer {
	void* start;
	unsigned int length;
}Video_Buffer;


int ioctl_(int fd, int request, void* arg);
int open_device(const char* device_name);
void start_stream(void);
void end_stream(void);
int init_device();
int init_mmap(void);
int read_frame(char* buf);
int process_frame(char* buf);
void close_mmap(void);
void close_device(void);

#endif